<?php
/** 
 * 默认主题
 * @package GenDiao
 * @author mrasong
 * @version 1.0
 * @link http://theui.net/
 * 
 */
?>
<?php $this->need('header.php'); ?>

<div class="gallery">
	<div class="s_show">
	  <div class="s_show_pic"></div>
	  <div class="s_show_tit"></div>
	  <div class="s_show_mask"></div>
	</div>
	<ul class="s_list">
	<?php 
		$this->widget('Widget_Archive@Cate_'.___PROD___, 'type=category&pageSize=12', 'slug='.___PROD___ )->to($slide);
		$ss = 0;
		while( $slide->next() ){
			$attach = $this->db->fetchRow($this->db->select()->from('table.contents')->where('type = \'attachment\' AND parent = ?', $slide->cid));
			$attach_url = $attach_src = Typecho_Common::url('images/nopic.gif', $this->options->themeUrl);
			if(!empty($attach)){
				$attach_text = unserialize($attach['text']);
				$attach_path = $attach_text['path'];
				$attach_url = Typecho_Common::url(___PREVIEW___.$attach_path, $this->options->index);
				$attach_src = Typecho_Common::url($attach_path, $this->options->index);
			}
			echo "\t\t<li><img class='img' src='{$attach_url}' data-original='{$attach_src}' rel='{$slide->permalink}' alt='{$ss}' title='{$slide->title}' /></li>" . PHP_EOL;
			$ss++;
		}
	?>
	</ul>
</div>
<div class="index_content">
	<div class="about">
		<?php $about = $this->db->fetchRow($this->db->select()->from('table.contents')->where('type = "page" AND slug = ?', 'about')); ?>
		<div class="box_title"><b><?php echo $about['title']; ?></b><span><a href="<?php $this->options->index('about.shtml'); ?>">更多</a></span></div>
		<div class="box_content"><?php echo $about['text']; ?></div>	
	</div>
	
	<div class="info">
		<div class="box_title"><b>根雕新闻</b><span><a href="<?php $this->options->index('category/'.___NEWS___); ?>">更多</a></span></div>
		<ul class="box_list">		
		<?php $this->widget('Widget_Archive@Cate_'.___NEWS___, 'type=category&pageSize=8', 'slug='.___NEWS___ )
					->parse("\t\t\t<li><a href='{permalink}' title='{title}'>{title}</a></li>"); ?>
		</ul>
	</div>
	
	<div class="news">
		<div class="box_title"><b>根雕资讯</b><span><a href="<?php $this->options->index('category/'.___INFO___); ?>">更多</a></span></div>
		<ul class="box_list">
		<?php $this->widget('Widget_Archive@Cate_'.___INFO___, 'type=category&pageSize=8', 'slug='.___INFO___ )
					->parse("\t\t\t<li><a href='{permalink}' title='{title}'>{title}</a></li>"); ?>
		</ul>
	</div>
</div>
<div class="links">
	<div class="links_nav">
		<a rel="0" class="on">友情链接</a>
		<a rel="1">常用网站</a>
	</div>
	<div class="clear"></div>
	<div class="links_div" style="display:block;">
		<p>
		<a href="http://www.baidu.com/" target="_blank">百度搜索</a>
		<a href="http://mail.163.com/" target="_blank">网易邮箱</a>
		<a href="http://www.baidu.com/" target="_blank">百度搜索</a>
		<a href="http://www.baidu.com/" target="_blank">百度搜索</a>
		</p>
	</div>
	<div class="links_div">
		2222222 222
	</div>
</div>
<?php $this->need('footer.php'); ?>
